#!/usr/bin/perl
 
# Create filehandle for write called WFILEHANDLE for file perl.txt
# if the file does not exists it will be created. 
open (WFILEHANDLE, ">perl.txt") or die ("Cannot open perl.txt .\n");

# Insert data to perl.txt
print WFILEHANDLE "Perl Programming Tutorial";

#Close filehandle.
close (WFILEHANDLE);

# Create filehandle for read called RFILEHANDLE for file perl.txt
open (RFILEHANDLE, "perl.txt")

# read file and print to 
while () {
print;
}